/**
 * 
 */
package tests.client.view;

import tests.client.resources.GlobalResources;

import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Image;

/**
 * @author Thien
 * 
 * <p>The header of the application home page</p>
 *
 */
public class HeaderPanel extends Composite {
	
	public HeaderPanel() {		
		
		FlexTable flexTable = new FlexTable();
		
		Image logo = new Image(GlobalResources.INSTANCE.logoSmall());
		flexTable.setWidget(0, 0, logo);
		
		/*Label tagLine = new Label("Your feeds are belong to us");
		flexTable.setWidget(0, 1, tagLine);
		
		Label welcome = new Label("Welcome back foo@bar - ");
		flexTable.setWidget(0, 2, welcome);*/
		
		flexTable.setText(0, 1, "Your feeds are belong to us");
		flexTable.setText(0, 2, "Welcome back foo@bar - ");
		
		Anchor logOut = new Anchor("Log Out");
		flexTable.setWidget(0, 3, logOut);
		
		// styles
		/*flexTable.addStyleName(GlobalResources.INSTANCE.globalStyles().html());
		flexTable.getCellFormatter().addStyleName(0, 0, GlobalResources.INSTANCE.globalStyles().html());
		flexTable.getCellFormatter().addStyleName(0, 1, GlobalResources.INSTANCE.globalStyles().html());*/
		flexTable.getCellFormatter().addStyleName(0, 1, GlobalResources.INSTANCE.globalStyles().tagLine());
		//flexTable.getCellFormatter().addStyleName(0, 2, GlobalResources.INSTANCE.globalStyles().html());
		flexTable.getCellFormatter().addStyleName(0, 2, GlobalResources.INSTANCE.globalStyles().welcomeDiv());
		//flexTable.getCellFormatter().addStyleName(0, 3, GlobalResources.INSTANCE.globalStyles().html());
		logo.addStyleName(GlobalResources.INSTANCE.globalStyles().logoSmall());
		/*tagLine.addStyleName(GlobalResources.INSTANCE.globalStyles().tagLine());
		welcome.addStyleName(GlobalResources.INSTANCE.globalStyles().welcomeDiv());*/
		logOut.addStyleName(GlobalResources.INSTANCE.globalStyles().logOut());
		
		initWidget(flexTable);
		// content
		/*FlowPanel panel = new FlowPanel();
		Image logo = new Image(GlobalResources.INSTANCE.logoSmall());
		panel.add(logo);
		HTML tagLine = new HTML("Your feeds are belong to us"), welcome = new HTML("<b>Welcome back foo@bar.com -</b>");
		tagLine.setTitle("Tag line");
		//tagLine.setSize("150", "48");
		//welcome.setSize("150", "48");
		panel.add(tagLine);
		panel.add(welcome);
		Anchor signOutLink = new Anchor("Log Out");
		//signOutLink.setSize("150", "48");		
		panel.add(signOutLink);
		initWidget(panel);*/
		
		/*DockLayoutPanel panel = new DockLayoutPanel(Unit.PX);
		panel.addWest(new Image(GlobalResources.INSTANCE.logoSmall()), 50);		
		panel.addEast(new Anchor("Log out"), 50);
		panel.addEast(new Label("Welcome back foo@bar.com"), 50);		
		panel.add(new Label("Your feeds are belong to us"));
		initWidget(panel);*/
		
		// styles
		/*logo.addStyleName(GlobalResources.INSTANCE.globalStyles().logoSmall());
		tagLine.addStyleName(GlobalResources.INSTANCE.globalStyles().tagLine());
		welcome.addStyleName(GlobalResources.INSTANCE.globalStyles().welcomeDiv());*/
		
		/*HTMLPanel panel = new HTMLPanel("<div id='logo'></div>" + "<div><div>Welcome back foo@bar.com - </div>"
				+ "<div>Your feeds are belong to us</div></div>");
		panel.add(new Image(resources.logoSmall()), "logo");
		initWidget(panel);*/
		
	}

}
